package com.df.springmvc.bi.xzsp.controller;

import java.util.ArrayList;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.MessageSource;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import com.df.springmvc.bi.rcjg.services.rcjgServices;
import com.df.springmvc.bi.xzsp.services.xzspServices;
import com.df.springmvc.common.bean.MsgBean;
import com.df.springmvc.common.util.WebUtil;
import com.df.springmvc.supper.SupperController;



@Controller
@RequestMapping("/bi/xzsp")
/**
 * 信息资源平台页面控制
 * @author David
 *
 */
public class xzspController extends SupperController{
	String page_staff="bi/xzsp/";
	@Autowired
	xzspServices services;
	
	public xzspController(){
		// TODO Auto-generated constructor stub
		//
	}
	//欢迎页
	@RequestMapping(value={"/"})
	public String excute(ModelMap model,HttpServletRequest request,HttpServletResponse response){
		org.apache.log4j.Logger.getLogger(getClass()).info("bipage");
		return page_staff;
	}
	//主题主页
	@RequestMapping(value={"/toxzsp" })
	public String toView(ModelMap model,HttpServletRequest request,HttpServletResponse response){
		try{
			
		}catch(Exception e){
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return page_staff + "xzsp";
	}
	//生产报表页面
		@RequestMapping(value={"/toxzspsc" })
		public String toxzspsc(ModelMap model,HttpServletRequest request,HttpServletResponse response){
			try{
				
			}catch(Exception e){
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			return page_staff + "xzsp-sc";
		}
		//经营报表页面
		@RequestMapping(value={"/toxzspjy" })
		public String toxzspjy(ModelMap model,HttpServletRequest request,HttpServletResponse response){
			try{
						
				}catch(Exception e){
						// TODO Auto-generated catch block
					e.printStackTrace();
				}
					return page_staff + "xzsp-jy";
			}
		/**
		 * 获取生产报表信息
		 * @return
		 * @throws Exception
		 */
		@RequestMapping("/getscinfo")
		public void getscinfo(ModelMap model,HttpServletRequest request,HttpServletResponse response){
			try{
				Object o=services.getGetsc(getParamMap(request,"map"));
				WebUtil.json(response,new MsgBean(o));
				// WebUtil.json(response,new MsgBean(gridBean));
			}catch(Exception e){
				// TODO Auto-generated catch block
				e.printStackTrace();
				WebUtil.json(response,new MsgBean(e.getMessage(),false));
			}
		}
		/**
		 * 获取经营报表信息
		 * @return
		 * @throws Exception
		 */
		@RequestMapping("/getjyinfo")
		public void getjyinfo(ModelMap model,HttpServletRequest request,HttpServletResponse response){
			try{
				Object o=services.getGetjy(getParamMap(request,"map"));
				WebUtil.json(response,new MsgBean(o));
				// WebUtil.json(response,new MsgBean(gridBean));
			}catch(Exception e){
				// TODO Auto-generated catch block
				e.printStackTrace();
				WebUtil.json(response,new MsgBean(e.getMessage(),false));
			}
		}
		/**
		 * 获取单位信息(生产)
		 * @return
		 * @throws Exception
		 */
		@RequestMapping("/getorginfo")
		public void getOrgInfo(ModelMap model,HttpServletRequest request,HttpServletResponse response){
			try{
				Object o=services.getOrgInfo();
				WebUtil.json(response,new MsgBean(o));
				// WebUtil.json(response,new MsgBean(gridBean));
			}catch(Exception e){
				// TODO Auto-generated catch block
				e.printStackTrace();
				WebUtil.json(response,new MsgBean(e.getMessage(),false));
			}
		}
		/**
		 * 获取单位信息(经营)
		 * @return
		 * @throws Exception
		 */
		@RequestMapping("/getorgsinfo")
		public void getOrgsInfo(ModelMap model,HttpServletRequest request,HttpServletResponse response){
			try{
				Object o=services.getOrgsInfo();
				WebUtil.json(response,new MsgBean(o));
				// WebUtil.json(response,new MsgBean(gridBean));
			}catch(Exception e){
				// TODO Auto-generated catch block
				e.printStackTrace();
				WebUtil.json(response,new MsgBean(e.getMessage(),false));
			}
		}
}

